var mysql = require("mysql");
var config = require("./config.js");

var Client = mysql.createConnection(config.mysql_options);

function connection(sql,params,callback){
  Client.query(sql,params,function(error,result){
    if(error){
      console.log(error);
      callback(error);
      return;
    }
    callback(result)
  })
}

module.exports = connection;
